from elasticsearch_dsl import Document, Text, connections
from django.conf import settings

# 配置ES连接
connections.create_connection(hosts=[settings.ELASTICSEARCH_HOST])


class TPADocument(Document):
    mongo_id = Text()
    problem = Text()

    class Index:
        name = 'tpa_index'
        settings = {
            'number_of_shards': 1,
            'number_of_replicas': 0
        }
